package com.eop.managedBean;

import java.io.Serializable;
import java.util.Date;

import javax.faces.model.SelectItem;

import org.operamasks.faces.annotation.Accessible;
import org.operamasks.faces.annotation.Bind;
import org.operamasks.faces.annotation.SaveState;
import org.operamasks.faces.annotation.SelectItems;

import com.base.common.provider.CommonKeySelectItemProvider;
import com.base.commons.SpringBeanHolder;
import com.eop.entity.EmergencyStage;
import com.eop.service.IEmergencyStageService;
import com.eop.service.IEventService;

public class BaseEmergencyStageBean implements Serializable {
	protected IEmergencyStageService ecyService = SpringBeanHolder
			.getBean("stageService");
	protected IEventService eventService = SpringBeanHolder
			.getBean("eventService");
	@Bind
	@Accessible
	@SaveState
	protected String id;
	protected EmergencyStage es;

	@Accessible
	protected SelectItem[] Stage_B_items = CommonKeySelectItemProvider
			.getTopCommonKey("stage", false);
	@Bind(id = "Stage_B")
	@SelectItems(source = "#{this.Stage_B_items}")
	protected String Stage_B;
	@Accessible
	protected SelectItem[] Stage_S_items = {};
	@Bind(id = "Stage_S")
	@SelectItems(source = "#{this.Stage_S_items}")
	protected String Stage_S;
	@Bind(id = "Stage_Content", attribute = "value")
	protected String Stage_Content;
	@Bind(id = "Stage_Date", attribute = "value")
	protected Date Stage_Date;

	protected void setEcyStageProperty() {
		if (es == null)
			return;
		es.setId(id);
		// es.setCreateDate(createDate);
		// es.setCreateUser(createUser);
		es.setStage_b(Stage_B);
		es.setStage_content(Stage_Content);
		es.setStage_s(Stage_S);
		es.setStageDate(Stage_Date);

		es.setDelFlag(false);
	}

	protected void getEcyStageProperty(EmergencyStage es) {
		id = es.getId();
		Stage_B = es.getStage_b();
		Stage_S = es.getStage_s();
		Stage_Date = es.getStageDate();
		Stage_Content = es.getStage_content();

	}

}
